<template>
  <view v-if="url">
    <web-view :webview-styles="webviewStyles" :src="targetURL"></web-view>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        webviewStyles: {
          progress: {
            color: "#FF3333"
          }
        },
        targetURL: null
      }
    },
    onLoad(options) {
      this.params = options
      if (options.title) {
        uni.setNavigationBarTitle({
          title: options.title
        })
      }
      this.targetURL = decodeURIComponent(options.url);
    }
  }
</script>